<template>
	<view>
		<view class="issueDetailHead">
			<view class="item">
				<view class="itemLeft">
					任务平台:
				</view>
				<view v-if="taskObject.platform == 'douyin'" class="itemRight">
					【抖音】
				</view>
				<view v-if="taskObject.platform == 'kuaishou'" class="itemRight">
					【快手】
				</view>
				<view v-if="taskObject.platform == 'xiaohongshu'" class="itemRight">
					【小红书】
				</view>
			</view>
			<view class="item">
				<view class="itemLeft">
					任务类型:
				</view>
				<view v-if="taskObject.type == '1'" class="itemRight">
					关注
				</view>
				<view v-if="taskObject.type == '2'" class="itemRight">
					点赞
				</view>
				<view v-if="taskObject.type == '3'" class="itemRight">
					评价
				</view>
				<view v-if="taskObject.type == '4'" class="itemRight">
					收藏
				</view>
				<view v-if="taskObject.type == '5'" class="itemRight">
					刷单
				</view>
			</view>
			<view class="item">
				<view class="itemLeft">
					任务名称:
				</view>
				<view class="itemRight">
					{{ taskObject.task_name }}
				</view>
			</view>
			<view class="item">
				<view class="itemLeft">
					佣金:
				</view>
				<view class="itemRight">
					¥{{ taskObject.price }}元
				</view>
			</view>
			<view class="item">
				<view class="itemLeft">
					是否加急:
				</view>
				<view v-if="taskObject.is_urgent == '1'" class="itemRight">
					是
				</view>
				<view v-else class="itemRight">
					否
				</view>
			</view>
			<view class="item">
				<view class="itemLeft">
					活动截止时间:
				</view>
				<view class="itemRight">
					{{ taskObject.end_time?taskObject.end_time : '无' }}
				</view>
			</view>
		</view>
		
		
		<view class="issueDetailBody">
			<view class="bodyTop">
				<view class="topBody">
					任务描述:
				</view>
				<view class="btmBody">
					{{ taskObject.description ? taskObject.description: '无描述' }}
				</view>
			</view>
			<view class="bodybtn">
				<view class="bodyPhoto">
					截图实例图片:
				</view>
				<view class="btmPhoto">
					<view style="color: #CCCCCC;margin-left: 20px;" v-if="!taskObject.pics">
						无截图实例图片
					</view>
					<image @click="previewImage" v-for="(item,index) in taskObject.pics" :key="index" :src="item"></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				taskObject:{}
			};
		},
		
		onLoad(e) {
			this.$api.getPostTaskDetail(e.id,res => {
				this.taskObject = res.data
			})
		},
		methods:{
			//预览图片
			previewImage() {
				uni.previewImage({
					current: 0,
					urls: this.taskObject.pics,
					})
			}
		}
	}
</script>

<style lang="less">
.issueDetailHead {
	height: 500rpx;
	background-color: #FFFFFF;
	margin: 20rpx 0;
	.item {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 20rpx;
	}
}
.issueDetailBody {
	height: 500rpx;
	background-color: #FFFFFF;
	padding: 20rpx;
	.bodyTop {
		.topBody {
			margin-bottom: 20rpx;
		}
		.btmBody {
			margin-bottom: 20rpx;
			word-wrap:break-word;
		}
	}
	.bodybtn {
		.bodyPhoto {
			margin-bottom: 20rpx;
		}
		.btmPhoto {
			image {
				width: 100rpx;
				height: 100rpx;
				margin-right: 20rpx;
			}
		}
	}
}
</style>
